package org.dtrd.modules.food.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.food.entity.bean.FoodMatchingDetail;

import java.util.Date;


/**
 * <p>
 * 配餐:早午晚三餐
 * </p>
 *
 * @author QR
 * @since 2021-12-09
 */
@Getter
@Setter
@TableName("dtrd_ext_ems_yw_food_matching")
public class DtrdExtEmsYwFoodMatching {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 配餐名称
     */
    @TableField("matching_name")
    private String matchingName;

    /**
     * 配餐缩略图
     */
    @TableField("matching_thumb")
    private String matchingThumb;

    /**
     * 是否是加餐:0-否，1-是
     */
    @TableField("matching_meal")
    private String matchingMeal;

    /**
     * 配餐千卡
     */
    @TableField("matching_kcal")
    private Integer matchingKcal;

    /**
     * 配餐用油
     */
    @TableField("matching_oil")
    private String matchingOil;

    /**
     * 配餐分类
     */
    @TableField("matching_categoryId")
    private Integer matchingCategoryid;

    /**
     * 最后编辑人
     */
    @TableField("matching_editor")
    private String matchingEditor;

    /**
     * 最后编辑时间
     */
    @TableField("matching_edit_time")
    private Date matchingEditTime;

    /**
     * 删除人
     */
    @TableField("matching_deleter")
    private String matchingDeleter;

    /**
     * 删除时间
     */
    @TableField("matching_del_time")
    private Date matchingDelTime;

    /**
     * 创建人
     */
    @TableField("matching_creater")
    private String matchingCreater;

    /**
     * 创建时间
     */
    @TableField("matching_create_time")
    private Date matchingCreateTime;

    /**
     * 主食
     */
    @TableField("matching_food")
    private String matchingFood;

    /**
     * 菜
     */
    @TableField("matching_cookbook")
    private String matchingCookbook;

    @TableField("matching_url")
    private String matchingUrl;

    /**
     * 脂肪/克
     */
    @TableField("matching_fat")
    private String matchingFat;

    /**
     * 蛋白质
     */
    @TableField("matching_protein")
    private String matchingProtein;

    /**
     * 膳食纤维
     */
    @TableField("matching_df")
    private String matchingDf;

    /**
     * 碳水化合物
     */
    @TableField("matching_carbohydrate")
    private String matchingCarbohydrate;

    /**
     * 胆固醇
     */
    @TableField("matching_cholesterin")
    private String matchingCholesterin;

    public DtrdExtEmsYwFoodMatching init() {
        isDel = 0;
        matchingCreateTime = new Date();
        return this;
    }

    public DtrdExtEmsYwFoodMatching parseFromDto(FoodMatchingDetail dto) {
        dataId = dto.getDataId();
        matchingName = dto.getMatchingName();
        matchingThumb = dto.getMatchingThumb();
        matchingMeal = dto.getMatchingMeal();
        matchingKcal = dto.getMatchingKcal();
        matchingOil = dto.getMatchingOil();
        matchingCategoryid = dto.getMatchingCategoryid();
        matchingFood = dto.getMatchingFood();
        matchingCookbook = dto.getMatchingCookbook();
        matchingUrl = dto.getMatchingUrl();
        matchingFat = dto.getMatchingFat();
        matchingProtein = dto.getMatchingProtein();
        matchingDf = dto.getMatchingDf();
        matchingCarbohydrate = dto.getMatchingCarbohydrate();
        matchingCholesterin = dto.getMatchingCholesterin();
        return this;
    }


}
